<!doctype html>
<html>
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <title>充值</title>
    <link rel="stylesheet" type="text/css" href="../../../css/api.css"/>
    <link rel="stylesheet" type="text/css" href="../../../css/common.css" />
    <link rel="stylesheet" type="text/css" href="../../../css/aui.css" />
    <link rel="stylesheet" type="text/css" href="../../../css/aui-pull-refresh.css" />
    <link rel="stylesheet" type="text/css" href="../../../css/swiper.min.css"/>
    <link rel="stylesheet" type="text/css" href="../../../css/style.css"/>
    <style>
    html,body{
        background: #fff;
    }
    .inner_header{
        font-size: 1.6rem;
        color: #000000;
        font-weight: 600;
        height: 6.9rem;
        margin: 0;
        padding: 2.4rem 0 0 0;
        box-sizing: border-box;
        background: none!important;
        box-shadow: 0rem 0rem 0.8rem 0rem rgba(0, 0, 0, 0.08);
    }
    .content{
        width: 93%;
        margin:8.25rem auto auto auto;
        height: 22.2rem;
    	box-shadow: 0rem 0rem 0.9rem 0rem
    		rgba(0, 0, 0, 0.08);
    	border-radius: 0.7rem;
        box-sizing: border-box;
        padding: 0 0 0 1rem;
    }
    .content_top{
        width: 100%;
        height: 5.55rem;
        box-sizing: border-box;
        border-bottom:0.1rem solid #f5f5f7;
    }
    .content_center{
        width: 100%;
        height: 12.8rem;
        box-sizing: border-box;
        border-bottom:0.1rem solid #f5f5f7;
    }
    .content_top_text{
        width: 100%;
        height: 1.4rem;
    	font-size: 1.4rem;
        line-height: 1.4rem;
    	letter-spacing: 0.03rem;
    	color: #333333;
        margin: 2.25rem 0 0 0;
        float: left;
        box-sizing: border-box;
        padding:  0 1rem 0 0;
    }
    .content_top_text .title{
        float: left;
        font-size: 1.3rem;
        color: #999999!important;
    }
    .content_top_text .fun{
        float:right;
    }
    .content_top_text .icon{
        float: right;
        margin-left: 0.75rem;
        width: 0.7rem;
        height: 1.3rem;
        position: relative;
        top: 0.05rem;
    }
    .content_center .title{
        width: 100%;
        font-size: 1.31rem;
        letter-spacing: 0.03rem;
	    color: #999999;
        line-height: 1.31rem;
        height: 1.31rem;
        float: left;
        margin: 2.25rem 0 2.05rem 0;
    }
    .content_center_box{
        width: 100%;
        height: 5.35rem;
    }
    .content_center_box .symbol{
        width: 7%;
        height: 100%;
        float: left;
        text-align: center;
        line-height: 5.35rem;
        font-size: 2.46rem;
        color: #333333;
    }
    .content_center_box_ipt{
        width: 90%!important;
        height: 100%!important;
        float: left;
        line-height: 5.35rem!important;
        font-size: 2.46rem!important;
        box-sizing: border-box;
        padding: 0 0 0 0.9rem!important;
        color: #ed6a20!important;
        text-shadow: 0px 0px 0px #495057;
        -webkit-text-fill-color: transparent;
    }
    .content_bottom{
        width: 100%;
        height: 3.85rem;
        font-size: 1.2rem;
        letter-spacing: 0.03rem;
        color: #999999;
        line-height: 3.85rem;
    }
    .bottom_btn{
        width: 93%;
        margin: 5.95rem auto 0 auto;
    	color: #ffffff;
        font-size: 1.6rem;
        height: 4rem;
        line-height: 4rem;
        text-align: center;
        background-color: #ed6a20;
        border-radius: 1.98rem;
    }
    /*支付模块css*/

    .pay-modular {
        /*背景*/
        width: 100%;
        height: 100%;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        margin: auto;
        background: rgba(0, 0, 0, 0.5);
        z-index: 10;
        transition: 0.2s ease all
    }

    .modular-main {
        height: 43.95rem;
        width: 100%;
        float: left;
        position: absolute;
        bottom: 0;
        left: 0;
        background: #f2f2f2;
        border-radius: 1.25rem 1.25rem 0 0;
        /*transition: 0.5s ease all*/
        animation: myfirst 0.3s;
    }

    .modular-main-top {
        width: 100%;
        height: 4.6rem;
        box-sizing: border-box;
        border-bottom: 0.05rem solid #ebebeb;
        float: left;
        font-size: 1.8rem;
        line-height: 4.6rem;
        text-align: center;
        position: relative;
        border-radius: 1.25rem 1.25rem 0 0;
    }

    .pay-modular-colse {
        width: 1.3rem;
        height: 1.3rem;
        position: absolute;
        top: 1.6rem;
        left: 1.35rem;
    }

    @keyframes myfirst {
        0% {
            left: 0;
            bottom: -43.95rem;
        }
        100% {
            left: 0;
            bottom: 0;
        }
    }

    .modular-main-box {
        width: 100%;
        float: left;
    }

    .modular-select-pay {
        width: 100%;
        height: 39.35rem;
    }

    .modular-select-pay-money {
        width: 100%;
        height: 7.25rem;
        line-height: 7.25rem;
        font-size: 3.6rem;
        font-weight: 600;
        text-align: center;
        background: #fff;
        float: left;
    }

    .modular-select-list {
        width: 100%;
        float: left;
        background: #fff;
    }

    .modular-select-li {
        width: 100%;
        height: 6.05rem;
        float: left;
    }

    .li-img {
        width: 14.53%;
        float: left;
    }

    .li-content {
        width: 85.47%;
        float: left;
        height: 100%;
        position: relative;
        box-sizing: border-box;
        border-bottom: 0.05rem solid #ebebeb
    }

    .modular-select-li .li-content:last-child {
        border-bottom: none;
    }

    .li-content-title {
        width: 100%;
        height: 1.5rem;
        font-size: 1.5rem;
        line-height: 1.5rem;
        letter-spacing: 0.02rem;
        color: #171717;
        margin: 1.3rem 0 0.8rem 0;
    }

    .li-content-text {
        width: 100%;
        height: 1.1rem;
        font-size: 1.1rem;
        line-height: 1.1rem;
        color: #848689;
    }

    .alipay {
        width: 2.45rem;
        height: 2.45rem;
        margin: 1.85rem auto auto auto;
    }

    .weixinpay {
        width: 2.5rem;
        height: 2.5rem;
        margin: 1.75rem auto auto auto;
    }

    .h5pay {
        width: 3rem;
        height: 2.4rem;
        margin: 1.75rem auto auto auto;
    }

    .balancepay {
        width: 2.5rem;
        height: 2.5rem;
        margin: 1.85rem auto auto auto;
    }

    .li-content-check {
        float: right;
        display: inline-block;
        position: absolute;
        top: 2rem;
        right: 1.35rem;
    }

    .li-content-check img {
        width: 1.95rem;
        height: 1.95rem;
    }

    .modular-select-bottom {
        width: 100%;
        height: 7.9rem;
        float: left;
    }

    .modular-select-btn {
        width: 93%;
        height: 4rem;
        background-color: #ed6a20;
        border-radius: 1.98rem;
        margin: auto;
        font-size: 1.6rem;
        line-height: 4rem;
        text-align: center;
        color: #ffffff;
        margin: 2.4rem auto 0 auto;
    }

    .modular-ipt-password {
        height: 39.35rem;
        width: 100%;
        position: relative;
        float: left;
    }

    .ipt-password {
        width: 93%;
        height: 4.65rem;
        border-radius: 0.5rem;
        border: solid 0.05rem #888888;
        display: flex;
        margin: 2.7rem auto 1.25rem auto;
    }

    .ipt-password-i {
        width: 100%;
        height: 100%;
        text-align: center;
        line-height: 4.65rem;
        border-right: 0.05rem solid #888888;
    }

    .ipt-password .ipt-password-i:last-child {
        border-right: none;
    }

    .ipt-password-i .i-icon {
        width: 2rem;
        height: 2rem;
        margin: 1.325rem auto auto auto;
        background: #000;
        border-radius: 100%;
    }

    .forget {
        width: 100%;
        text-align: right;
        font-size: 1.5rem;
        line-height: 1.5rem;
        height: 1.5rem;
        color: #ed6a20;
        box-sizing: border-box;
        padding: 0 1.5rem;
    }

    .keyboard {
        width: 100%;
        float: left;
        position: absolute;
        bottom: 0;
        left: 0;
        background: #fff;
    }

    .keyboard-btn {
        width: 33.33%;
        float: left;
        height: 5.1rem;
        box-sizing: border-box;
        border-bottom: 0.05rem solid #8d8d8d;
        border-right: 0.05rem solid #8d8d8d;
    }

    .keyboard-btn-text {
        width: 100%;
        font-size: 2rem;
        line-height: 2rem;
        font-weight: 600;
        text-align: center;
        margin: 1rem 0 0 0;
        float: left;
    }

    .keyboard-btn-en {
        width: 100%;
        height: 0.85rem;
        line-height: 0.85rem;
        font-size: 0.85rem;
        text-align: center;
        float: left;
        margin: 0.6rem 0 0 0;
    }

    .text-zero {
        margin: 1.65rem 0 0 0;
    }

    .border-r-none {
        border-right: none;
    }

    .border-b-none {
        border-bottom: none;
    }

    .bgd2d5db {
        background: #d2d5db
    }

    .delete-num {
        width: 2.4rem;
        height: 1.7rem;
        margin: 1.95rem auto 0 auto;
    }

    .bgfff {
        background: #fff
    }

    .bgf2 {
        background: #f2f2f2
    }

    .pay-modular-arrow {
        width: 0.75rem;
        height: 1.45rem;
        position: absolute;
        top: 1.5rem;
        left: 1.3rem;
    }
    </style>
</head>
<body>
    <div id="app">
        <header class="aui-bar aui-bar-nav aui-bar-light inner_header">
          <a class="aui-pull-left aui-btn" onclick="goBack()">
              <img src="../../../image/back.png">
          </a>
          <div class="aui-title">{{type=='recharge'?"充值":"提现申请"}}</div>
        </header>
        <div class="content">
            <div class="content_top">
                <div class="content_top_text" @click="select_pay">
                    <span class="title" >{{type=='recharge'?"充值":"提现"}}方式</span>
                    <img src="../../../image/capital/icon4.png" alt="" class="icon">
                    <span class="fun">{{bank_name?bank_name:'尾号('+bank.last_cardid+')'}} </span>
                    <img :src="bank.bank_logo" alt="" style="float:right;position: relative;top:-0.8rem;">
                </div>
            </div>
            <div class="content_center">
                <div class="title">
                    {{type=='recharge'?"充值":"提现"}}金额
                </div>
                <div class="content_center_box">
                    <div class="symbol">￥</div>
                    <input type="tel" v-model="num" class="content_center_box_ipt" maxlength="4">
                </div>
            </div>
            <div class="content_bottom">
                最多{{type=='recharge'?"充值":"提现"}}5000
            </div>
        </div>
        <div class="bottom_btn" @click="submit">
            确认{{type=='recharge'?"充值":"提现"}}
        </div>
        <!-- 支付模块 -->
        <div class="pay-modular" v-if="is_pay==0?false:true">
            <div class="modular-main">
                <div class="modular-main">
                    <div class="modular-main-top" :class="pay_modular==0?'bgfff':'bgf2'">
                        <img src="../../../image/user/order_true/pay/close.png" alt="" class="pay-modular-colse" @click="close_pay_modular" v-if="pay_modular==0?true:false">
                        <img src="../../../image/user/order_true/pay/arrow_2.png" alt="" class="pay-modular-arrow" @click="back_pay_modular" v-if="pay_modular==1?true:false"> {{pay_modular==0?"确认付款":"请输入支付密码"}}
                    </div>
                    <div class="modular-main-box">
                        <div class="modular-select-pay" v-if="pay_modular==0?true:false">
                            <div class="modular-select-pay-money">
                                ￥{{ num }}
                            </div>
                            <div class="modular-select-list">
                                <div class="modular-select-li" v-for="(item,key) in pay_function" @click="select_pay_fun(key)">
                                    <div class="li-img">
                                        <img :src="item.url" alt="" :class="item.en">
                                    </div>
                                    <div class="li-content">
                                        <div class="li-content-title">
                                            {{item.name}}
                                        </div>
                                        <div class="li-content-text">
                                            {{item.describe}}
                                        </div>
                                        <div class="li-content-check">
                                            <img :src="is_pay_fun==key?'../../../image/user/order_true/pay/check_on.png':'../../../image/user/order_true/pay/check_off.png'" alt="">
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <div class="modular-select-bottom">
                                <div class="modular-select-btn" @click="open_pay_ipt">
                                    立即付款
                                </div>
                            </div>
                        </div>
                        <div class="modular-ipt-password" v-if="pay_modular==1?true:false">
                            <div class="ipt-password">
                                <div class="ipt-password-i" v-for="(item,key) in ipt_box">
                                    <div class="i-icon" v-if="item.num?true:false"></div>
                                </div>
                            </div>
                            <div class="forget">忘记密码？</div>
                            <div class="keyboard">
                                <div class="keyboard-btn" v-for="(item,key) in pay_num" :class="item.additional_class" @click="check_ipt(key)">
                                    <div class="keyboard-btn-text" v-if="key<11?true:false" :class="key==10?'text-zero':''">
                                        {{item.num}}
                                    </div>
                                    <div class="keyboard-btn-en" v-if="key<10?true:false">
                                        {{item.en}}
                                    </div>
                                    <img src="../../../image/user/order_true/pay/delete.png" alt="" class="delete-num" v-if="key==11?true:false">
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</body>
</html>
<script type="text/javascript" src="../../../script/api.js"></script>
<script type="text/javascript" src="../../../script/axios.min.js"></script>
<script type="text/javascript" src="../../../script/axios-config.js"></script>
<script type="text/javascript" src="../../../script/zepto.js"></script>
<script type="text/javascript" src="../../../script/vue.min.js"></script>
<script type="text/javascript" src="../../../script/swiper.min.js"></script>
<script type="text/javascript" src="../../../script/utils.js"></script>
<script type="text/javascript" src="../../../script/common.js"></script>
<script type="text/javascript" src="../../../script/aui-tab.js"></script>
<script type="text/javascript" src="../../../script/aui-scroll.js"></script>
<script type="text/javascript" src="../../../script/aui-pull-refresh.js"></script>

<script type="text/javascript">

    apiready = function(){
    //setRefresh()
        var type = api.pageParam.data
        console.log(type)
        var vue = new Vue({
            el:"#app",
            data:{
                type:type,
                num:"",
                bank_name:"请选择",
                bank:"",
                is_pay: 0, //是否呼出输入弹窗 0=关闭 1弹出
                pay_modular: 0, //0=选择支付方式 1=输入密码
                is_pay_fun: 0, //支付方式0-3 顺序选择
                pay_function: [{
                    id: 1,
                    name: "支付宝",
                    describe: "支付宝安全支付",
                    url: "../../../image/user/order_true/pay/alipay.png",
                    en: "alipay"
                }, {
                    id: 2,
                    name: "微信支付",
                    describe: "微信安全支付",
                    url: "../../../image/user/order_true/pay/weixinpay.png",
                    en: "weixinpay"
                }, {
                    id: 3,
                    name: "银行卡支付",
                    describe: "推荐使用银行卡",
                    url: "../../../image/user/order_true/pay/h5pay.png",
                    en: "h5pay"
                }],
                pay_num: [{
                    id: 1,
                    num: 1,
                    en: "",
                    additional_class: "",
                }, {
                    id: 2,
                    num: 2,
                    en: "A B C",
                    additional_class: "",
                }, {
                    id: 3,
                    num: 3,
                    en: "D E F",
                    additional_class: "border-r-none",
                }, {
                    id: 4,
                    num: 4,
                    en: "G H I",
                    additional_class: "",
                }, {
                    id: 5,
                    num: 5,
                    en: "J K L",
                    additional_class: "",
                }, {
                    id: 6,
                    num: 6,
                    en: "M N O",
                    additional_class: "border-r-none",
                }, {
                    id: 7,
                    num: 7,
                    en: "P Q R S",
                    additional_class: "",
                }, {
                    id: 8,
                    num: 8,
                    en: "T U V",
                    additional_class: "",
                }, {
                    id: 9,
                    num: 9,
                    en: "W X Y Z",
                    additional_class: "border-r-none",
                }, {
                    id: 10,
                    num: "",
                    en: "",
                    additional_class: "border-b-none bgd2d5db",
                }, {
                    id: 11,
                    num: 0,
                    en: "",
                    additional_class: "border-b-none",
                }, {
                    id: 12,
                    num: "-2",
                    en: "",
                    additional_class: "border-r-none border-b-none bgd2d5db",
                    url: "../../image/user/order_true/pay/delete.png"
                }, ],
                ipt_box: [{
                    num: ""
                }, {
                    num: ""
                }, {
                    num: ""
                }, {
                    num: ""
                }, {
                    num: ""
                }, {
                    num: ""
                }],
                ipt_num: "",
            },
            mounted:function(){
                var that = this
                api.addEventListener({
                    name: 'select_bank'
                }, function(ret, err) {
                    var bank = ret.value.bank
                    that.bank = bank
                    that.bank_name = bank.bank_name
                });
            },
            methods:{
                //输入按键
                check_ipt: function(key) {
                    var num = this.pay_num[key].num //获取按键
                    var ipt_num = this.ipt_num
                    var ipt_box = this.ipt_box
                    console.log(ipt_num.length)
                    if (num == -2) { //如果是删除键
                        if (ipt_num.length > 0) {
                            ipt_box[ipt_num.length - 1].num = ""
                            ipt_num = ipt_num.substring(0, ipt_num.length - 1)
                            console.log(ipt_num)
                                // console.log(ipt_box)
                            this.ipt_num = ipt_num;
                            this.ipt_box = ipt_box
                        }
                        return false
                    }
                    if (ipt_num.length < 6) {
                        ipt_num += String(num)
                        console.log(ipt_num)
                        var length = ipt_num.length
                        ipt_box[length - 1].num = num
                        this.ipt_num = ipt_num;
                        this.ipt_box = ipt_box
                        if (ipt_num.length == 6) {
                        }
                    }

                },
                //后退
                back_pay_modular: function() {
                    this.pay_modular = 0
                },
                //选择支付方式
                select_pay_fun: function(key) {
                    this.is_pay_fun = key;
                    console.log(this.is_pay_fun);
                },
                //切换输入密码
                open_pay_ipt: function() {
                    var is_pay_fun = this.is_pay_fun
                    if (is_pay_fun == 0) {
                        this.alipayPay();
                        return;
                    }
                    if (is_pay_fun == 1) {
                        this.wechatPay();
                        return;
                    }
                    if (is_pay_fun == 2) {
                        api.toast({
                            msg: '功能还在开发中，敬请期待',
                            duration: 2000,
                            location: 'bottom'
                        });
                    }
                },
                //微信支付
                wechatPay: function() {
                    let weiXin = api.require('weiXin');
                    var $_this = this;
                    let data = {
                        token: $api.getStorage('token'),
                        out_trade_no: $_this.out_trade_no,
                        type:1,
                    }
                    console.log(JSON.stringify(data));
                    Axios.post(window.Url.wechatPay, data).then((res) => {
                        if (res.status == 1) {
                            console.log(JSON.stringify(res))
                            weiXin.payOrder({
                                orderId: String(res.prepayid),
                                partnerId: String(res.partnerid),
                                nonceStr: String(res.noncestr),
                                timeStamp: String(res.timestamp),
                                package: String(res.package),
                                sign: String(res.sign)
                            }, function(ret, err) {
                                console.log(JSON.stringify(ret))
                                console.log(JSON.stringify(err))
                                if (ret.status) {} else {}
                            });
                        }
                    }).catch((err) => {
                        api.alert({
                            msg: JSON.stringify(err.info)
                        });
                    })

                },
                // 支付宝支付
                alipayPay: function() {
                    var $_this = this;
                    let data = {
                        token: $api.getStorage('token'),
                        out_trade_no: $_this.out_trade_no,
                        type: 1,
                    }
                    console.log(JSON.stringify(data))
                    Axios.post(window.Url.alipayPay, data).then((res) => {
                        console.log(JSON.stringify(res));
                        if (res.status == 1) {
                            console.log(res.info);
                            var aliPay = api.require('aliPay');
                            aliPay.payOrder({
                                // orderInfo: 'app_id=2018030502318781&biz_content=%7B%22body%22%3A%22%5Cu751f%5Cu610f%5Cu5e2eAPP%5Cu8d2d%5Cu7269%5Cu652f%5Cu4ed8%22%2C%22subject%22%3A%22%5Cu751f%5Cu610f%5Cu5e2eAPP%5Cu8d2d%5Cu7269%5Cu652f%5Cu4ed8%22%2C%22out_trade_no%22%3A%2220181107165426ba81697745%22%2C%22timeout_express%22%3A%2230m%22%2C%22total_amount%22%3A%220.01%22%2C%22product_code%22%3A%22QUICK_MSECURITY_PAY%22%7D&charset=UTF-8&format=json&method=alipay.trade.app.pay&notify_url=http%3A%2F%2Ft.shunshiniao.net%2FApi%2FApi%2FFreeshopping_alipayCallback&sign_type=RSA2&timestamp=2018-11-07+16%3A54%3A30&version=1.0&sign=lLAeCEu1gcr1MYQinm%2FJj72RFvVroTFj1HvVkiU%2BG07Vk1dubBDQJisK90Y%2FnYnjG5vMgKuWd9w7pLKHnJajl0gcGV%2FoXcM4aXh7yO1g1zYeEi861TbJZ1u87tTT9S%2B2kTVZLxFUx%2FV0ZWdPfhhj55cGOi9oeqT%2BYeF5VpxSSyy7R%2FyHfLGf6iFh4AgQbwgxyUeSA1kl1%2BudKnc67YcmSzPVNLq3kiVpU1agaDixc1IDULs1TOeI978HLS%2B%2FWcpx7%2FGiG1RfSS0ttaaAzVpr3ZUnVz7UmK1LstVHusK6T7P2FNndFzZUHUJX28TlPM9K1SXbnT%2FPqaJGdxle%2FlDJeg%3D%3D'
                                orderInfo: res.info
                            }, function(ret, err) {
                                api.alert({
                                    title: '支付结果',
                                    msg: ret.code,
                                    buttons: ['确定']
                                });
                            });
                        }
                    }).catch((err) => {
                      console.log(JSON.stringify(err));
                        api.alert({
                            msg: JSON.stringify(err)
                        });
                    })

                },
                //关闭弹窗
                close_pay_modular: function() {
                    this.is_pay = 0;
                },
                //跳转到设置密码
                goPayPassword: function() {
                    api.openWin({
                        name: 'goPayPassword',
                        url: '../user/paysetting/paysetting',
                        pageParam: {

                        }
                    });
                },
                //打开弹窗
                open_pay_modular: function() {
                    let data = {
                            token: $api.getStorage('token'),
                            amount: this.num,
                            type:1  //积分充值
                        }
                    console.log(JSON.stringify(data))
                    Axios.post(window.Url.make_charge_order, data).then((res) => {  //生成订单
                        console.log(JSON.stringify(res));
                        if (res.status == 1) {
                            this.is_pay = 1;
                            this.out_trade_no = res.out_trade_no
                            // this.new_order_no = res.order_no;
                        } else {
                            api.toast({
                                msg: res.info,
                                duration: 2000,
                                location: 'bottom'
                            });
                        }
                    }).catch((err) => {
                        api.alert({
                            msg: JSON.stringify(err)
                        });
                    })
                },
                select_pay:function(){
                    if(this.type=="recharge"){  //如果为充值

                    }else { //如果为提现
                        api.openWin({
                            name: 'shareTixianList',
                            url: '../../share/share_tixian_list.html',
                            pageParam: {
                                test:''
                            }
                        });
                    }
                },
                submit:function(){
                    var bank_id = this.bank.bank_id
                    if(this.type=="recharge"){  //如果为充值
                        this.open_pay_modular()
                    }else { //如果为提现
                        var data={
                            token: $api.getStorage('token'),
                            amount:this.num,
                            type :1,
                            bank_id:bank_id
                        }
                        Axios.post(window.Url.apply_withdrawal,data).then(function(res){  //提现
                            console.log(JSON.stringify(res))
                            if(res.status==1){
                                api.toast({
                                    msg: res.info,
                                    duration: 2000,
                                    location: 'bottom'
                                });
                                setTimeout(function(){
                                    api.closeWin({});
                                },2000)
                            }else {
                                api.toast({
                                    msg: res.info,
                                    duration: 2000,
                                    location: 'bottom'
                                });
                            }
                        })
                    }
                }
            },
        })
   }
   function goBack(){
       api.closeWin({});
   }

  //刷新
function setRefresh(){
    var pullRefresh = new auiPullToRefresh({
        container: document.querySelector('.aui-refresh-content'),
        triggerDistance: 100
    }, function(ret) {
        if (ret.status == "success") {
            setTimeout(function() {
                pullRefresh.cancelLoading(); //刷新成功后调用此方法隐藏
            }, 1500)
        }
    })
}


</script>
